package main

import "fmt"

func main5() {
	amount := 2
	seats := 1

	if amount >= 2 {
		amount = amount - 2
		// 调用抽取出的seat()函数，座位的if判断，封装到seat()函数中
		seat(seats)
	} else {
		fmt.Println("余额不足，请先充值")
	}
}

func seat(seats int) {
	if seats > 0 {
		fmt.Println("请坐")
	} else {
		fmt.Println("暂时无座")
	}
}
